package com.tanhua.dubbo.api;

import com.tanhua.model.domain.Movement;
import com.tanhua.model.dto.MovementDto;
import com.tanhua.model.vo.PageResult;
import org.bson.types.ObjectId;

import java.util.List;

public interface MovementApi {

    /**
     * description: 发布动态 <br>
     * version: 1.0 <br>
     * date: 2021/11/15 20:27 <br>
     * author: SangWu <br>
     *
     * @param movementDto
     * @return void
     */
    ObjectId publish(MovementDto movementDto);

    /**
     * description: 分页查询动态 通过 userId <br>
     * version: 1.0 <br>
     * date: 2021/11/15 21:01 <br>
     * author: SangWu <br>
     *
     * @param userId
     * @param page
     * @param pagesize
     * @return com.tanhua.model.vo.PageResult
     */
    PageResult findByUserId(Long userId, Integer page, Integer pagesize, Integer state);

    /**
     * description: 分页查询好友动态 <br>
     * version: 1.0 <br>
     * date: 2021/11/16 16:44 <br>
     * author: SangWu <br>
     *
     * @param friendId
     * @param page
     * @param pagesize
     * @return java.util.List<com.tanhua.model.domain.Movement>
     */
    List<Movement> findFriendMovements(Long friendId, Integer page, Integer pagesize);

    /**
     * 随机获取推荐动态
     *
     * @param counts
     * @return
     */
    List<Movement> randomMovements(Integer counts);

    /**
     * 根据id查询单条动态
     *
     * @param movementId
     * @return
     */
    Movement findById(String movementId);

    /**
     * 通过Pids查询动态
     *
     * @param pids
     * @return
     */
    List<Movement> findByPids(List<Long> pids);

    /**
     * 动态审核,状态更新
     *
     * @param movementId
     * @param state
     */
    void update(ObjectId movementId, Integer state);

    /**
     * 保存好友时间线
     *
     * @param userId
     * @param movementId
     */
    void saveTimeLine(Long userId, ObjectId movementId);
}
